import { request } from '@ruifox-cms/utils'

//获取课程章节树
export function getCourseChapterTree(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/getCourseChapterTree',
    method: 'get',
    params
  })
}
//创建章节
export function createChapter(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/create',
    method: 'post',
    data
  })
}
//删除章节
export function deleteChapter(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//更新章节
export function updateChapter(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/update',
    method: 'post',
    data
  })
}
//用户获取课程实例笔记章节树
export function getCourseChapterTreeByUserChapter(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/getCourseChapterTreeByUser',
    method: 'get',
    params
  })
}
//重新排序同级章节
export function reorderSameLevelChapters(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/chapter/reorderSameLevelChapters',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
